<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>外边距塌陷问题</title>
    <style>
        .father {
            width: 500px;
            height: 500px;
            background-color: #ffbc0d;
            /*padding-top: 50px;*/

        }

        .son {
            width: 100px;
            height: 100px;
            background-color: #ab00ff;

            /*会有外边距塌陷问题，解决：父级使用padding-top而子级不用margin-top*/
            margin-top: 50px;
        }
    </style>
</head>
<body>

<div class="father">
    <div class="son"></div>
</div>

</body>
</html>
